﻿using System;
using BCCommon.Enums;
using BCEntity.Common.Wallet;
using System.Collections.Generic;
using BCCommon.PaymentEnums;

namespace BCData.Common.Wallet
{
    /// <summary>
    /// 钱包提现
    /// </summary>
    public interface IWalletTransferData
    {
        /// <summary>
        /// 创建提现
        /// </summary>
        /// <returns></returns>
        WalletTransferExtendEntity Create(WalletTransferEntity entity);

        /// <summary>
        /// 用户提现记录列表
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="index"></param>
        /// <param name="size"></param>
        /// <returns></returns>
        (List<WalletTransferExtendEntity>, int dataCount) GetUserWalletTransfer(long userId, int index, int size);

        /// <summary>
        /// 获取提现记录--单条
        /// </summary>
        /// <param name="walletTransferId">钱包提现Id</param>
        /// <returns></returns>
        WalletTransferExtendEntity Get(long walletTransferId);

        /// <summary>
        /// 获取提现记录--带分页列表
        /// </summary>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页数据条数</param>
        /// <param name="dataCount">总数据量</param>
        /// <param name="status">提现状态</param>
        /// <param name="appType">应用类型</param>
        /// <param name="userName">用户姓名</param>
        /// <param name="ascending">排序方式升序</param>
        /// <param name="phone">电话</param>
        /// <returns></returns>
        IEnumerable<WalletTransferExtendEntity> Get(int pageIndex, int pageSize, out int dataCount, CashOutStatusType? status, SourceAppType? appType, string userName, bool? ascending = null, string phone = null);

        /// <summary>
        /// 进度
        /// </summary>
        /// <param name="walletTransferId">钱包提现Id</param>
        /// <returns></returns>
        WalletTransferEntity SetAsProcessing(long walletTransferId);

        /// <summary>
        /// 审批通过
        /// </summary>
        /// <param name="walletTransferId">钱包提现Id</param>
        /// <param name="walletStatus">审核状态</param>
        /// <param name="TransferTime">提现成功时间</param>
        /// <returns></returns>
        WalletTransferExtendEntity Approve(long walletTransferId, CashOutStatusType walletStatus, DateTime? TransferTime);

        /// <summary>
        /// 审批拒绝
        /// </summary>
        /// <param name="walletTransferId">钱包提现Id</param>
        /// <param name="rejectRefuse">拒绝原因</param>
        /// <returns></returns>
        WalletTransferExtendEntity Reject(long walletTransferId, string rejectRefuse);

        /// <summary>
        /// 检查用户是否有待处理的提现记录
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <returns></returns>
        bool CheckPendingWithdraw(long userId);
    }
}